package com.xyz.study.design_mode.g_builder;

import com.xyz.study.design_mode.g_builder.mode.Computer;
import com.xyz.study.design_mode.g_builder.mode.ComputerBuilder;
import com.xyz.study.design_mode.g_builder.mode.ComputerBuilderConcrete;
import com.xyz.study.design_mode.g_builder.mode.Director;

/**
 * 生成实例：其三 ---- Builder 创建者模式
 * 组建复杂的实例
 * @author XYZ
 * @version 1.0.0
 * @since 2020/6/22
 */
public class BuilderMain {
    public static void main(String[] args) {
        ComputerBuilder lowComputerBuilder = new ComputerBuilderConcrete();
        new Director(lowComputerBuilder).construct("i5", "8G", "128G SSD", "varmilo", "lg");
        Computer lowConfigComputer = lowComputerBuilder.build();
        System.out.println(lowConfigComputer);


        ComputerBuilder highComputerBuilder = new ComputerBuilderConcrete();
        new Director(highComputerBuilder).construct("i9", "32G", "2T SSD", "varmilo", "lg");
        Computer highConfigComputer = highComputerBuilder.build();
        System.out.println(highConfigComputer);
    }
}
